package com.heima;

import java.util.ArrayList;

public class TestDemo01 {
    public static void main(String[] args) {
        demo01 t1 = new demo01("果果老师", "javase");
        demo01 t2 = new demo01("张1老师", "javaee");
        demo01 t3 = new demo01("张2老师", "php");
        demo01 t4 = new demo01("张3老师", "python");
        ArrayList<demo01> list = new ArrayList();
        list.add(t1);
        list.add(t2);
        list.add(t3);
        list.add(t4);
        for (int i = list.size() - 1; i >= 0; i--) {
            demo01 t = list.get(i);
            System.out.print("姓名:" + t.getName() + "，专业：" + t.getMajority());
            System.out.println();
        }
    }
}
